<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="favicon.ico">
    <link href="__PUBLIC__/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/admin/css/style.css?v=4.1.0" rel="stylesheet">
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/uploadify/uploadify.css"/>
    <script src="__PUBLIC__/admin/js/jquery.min.js?v=2.1.4"></script>
</head>

<body class="gray-bg">
<style>
    input.error{
        border:1px solid red;
    }
    span.error{
        padding-top:10px;
        color: #f00;
        font-size:12px;
    }
</style>

<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>分销商详细信息</h5>
                </div>
                <div class="ibox-content">
                    <form method="post" enctype="multipart/form-data" class="form-horizontal" id="form">
                        <div class="tabs-container">
                            <ul class="nav nav-tabs">
                                <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">基本信息</a></li>
                            </ul>
                            <div class="tab-content">

                                <div id="tab-1" class="tab-pane active">
                                    <div class="panel-body">
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">分销商等级:</label>
                                            <div class="col-sm-6">
                                                <select class="form-control m-b" name="grade_id">
                                                    <option value="">请选择</option>
                                                    {foreach name="grade_list" item="v"}
                                                    <option value="{$v.id}" {if condition="$info.grade_id eq $v['id']"}selected = "selected"{/if}>{$v.grade_name}</option>
                                                    {/foreach}
                                                </select>
                                            </div>
                                            <label class="col-sm-1" style="padding-top:7px; color:#F00; font-size:16px;">*</label>
                                        </div>
                                        <div class="hr-line-dashed"></div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">用户名：</label>
                                            <div class="col-sm-6">
                                                <div style="font-size:14px; width:200px; height:35px; line-height:35px;">{$info.user_name}</div>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">真实姓名：</label>
                                            <div class="col-sm-6">
                                                <input type="text" name="real_name" value="{$info.real_name}" class="form-control">
                                            </div>
                                            <label class="col-sm-1" style="padding-top:7px; color:#F00; font-size:16px;">*</label>
                                        </div>
                                        <div class="hr-line-dashed"></div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">手机号：</label>
                                            <div class="col-sm-6">
                                                <div style="font-size:14px; width:200px; height:35px; line-height:35px;">{$info.phone}</div>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">微信号：</label>
                                            <div class="col-sm-6">
                                                <div style="font-size:14px; width:200px; height:35px; line-height:35px;">{$info.wxnum}</div>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">累积佣金：</label>
                                            <div class="col-sm-6">
                                                <div style="font-size:14px; width:200px; height:35px; line-height:35px;">{$info.commission}</div>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">成为分销商时间：</label>
                                            <div class="col-sm-6">
                                                <div style="font-size:14px; width:200px; height:35px; line-height:35px;">{$info.create_time|date="Y-m-d H:i:s",###}</div>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>

                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">审核状态：</label>
                                            <div class="col-sm-6">
                                                <label class="radio-inline"><input type="radio" name="status" {if condition="$info.status eq 0"}checked="checked"{/if} value="0">审核拒绝</label>
                                                <label class="radio-inline"><input type="radio" name="status" {if condition="$info.status eq 1"}checked="checked"{/if} value="1">待审核</label>
                                                <label class="radio-inline"><input type="radio" name="status" {if condition="$info.status eq 2"}checked="checked"{/if} value="2">审核通过</label>
                                            </div>
                                        </div>
                                        <div class="hr-line-dashed"></div>

                                    </div>
                                </div>
                            </div>
                        </div>
                        <input type="hidden" name="id" value="{$info.id}" />
                        <input type="hidden" name="user_id" value="{$info.user_id}" />
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2" style="margin-top:20px; margin-left:0;">
                                <button class="btn btn-primary" type="submit" id="doSubmit">保存内容</button>
                                <button class="btn btn-primary" type="button" onclick="goBack();">返回</button>
                                <button type="reset" class="btn btn-default">重置</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 全局js -->
<script src="__PUBLIC__/admin/js/bootstrap.min.js?v=3.3.6"></script>
<!-- 自定义js -->
<script type="text/javascript" src="__PUBLIC__/uploadify/jquery.uploadify.min.js"></script>
<script src="__PUBLIC__/admin/js/plugins/layer/layer.min.js"></script>
<script src="__PUBLIC__/admin/js/plugins/validate/jquery.validate.min.js"></script>
<!-- iCheck -->
<script src="__PUBLIC__/admin/js/plugins/iCheck/icheck.min.js"></script>
<script src="__PUBLIC__/admin/js/common/ajax.js"></script>

<script type="text/javascript">

    var icon = "<i class='fa fa-times-circle'></i>&nbsp;&nbsp;";
    $('#form').validate({
        errorElement : 'span',
        debug: true,//只验证不提交表单
        //layer ajax提交表单
        submitHandler:function(){
            // 序列化 表单数据 后提交 ，太简洁了
            post("{:url('DistributionUser/edit')}",'POST',$('#form').serialize(),1);
            return false;
        },//这是关键的语句，配置这个参数后表单不会自动提交，验证通过之后会去调用的方法

        rules:{
            grade_id:{required:true},
            real_name:{required:true}
        },

        messages:{
            grade_id:{required:icon+'必选'},
            real_name:{required:icon+'必选'}
        }
    });

    function cl(){
        location.href = "{:url('DistributionUser/lst')}";
    }
</script>

</body>
</html>